package com.amphora.web.actions;

import java.io.IOException;
import java.util.Map;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/CalendarAction")
public class CalendarAction extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private static String VIEW_SCHEDULE = "/view_schedule.jsp";
	
	public CalendarAction() {
        super();
    }

	@SuppressWarnings({ "rawtypes" })
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		Map parameters = request.getParameterMap();
		String forward = "";
		
		if(parameters.containsKey("schedule")){
			forward = VIEW_SCHEDULE;
		}
		
		RequestDispatcher view = request.getRequestDispatcher(forward);
		view.forward(request,response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

	}

}
